package common;

import java.sql.*;

public class DateInfo   {
	
	
	static public int currentYear() {
		int year;
		Timestamp ts = new Timestamp(System.currentTimeMillis());
		try {
			year = Integer.parseInt(ts.toString().substring(0,4));		
		} catch (Exception e) {
			year = 2001;
		}		
		return year;	
	}
	
	static public int currentMonth() {
		int month;
		Timestamp ts = new Timestamp(System.currentTimeMillis());
		try {
			month = Integer.parseInt(ts.toString().substring(5,7));
		} catch(Exception e) {
			month = 1;
		}		
		return month;
	}
	
	static public int currentDay() {
		int day;
		Timestamp ts = new Timestamp(System.currentTimeMillis());
		try {
			day = Integer.parseInt(ts.toString().substring(8,10));
		} catch (Exception e) {
			day = 1;
		}
		return day;		
	}
	
			
}